﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Models="clr-namespace:BillsManager.Models;assembly=BillsManager.Models">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Values.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type StatusBar}">
        <Setter Property="Background" Value="{StaticResource DBConnectionState.NotConnected}" />

        <Style.Triggers>

            <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Disconnected}">
                <Setter Property="Background" Value="{StaticResource DBConnectionState.NotConnected}" />
            </DataTrigger>

            <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Connected}">
                <Setter Property="Background" Value="{StaticResource DBConnectionState.Connected}" />
            </DataTrigger>

            <DataTrigger Binding="{Binding ConnectionState, Mode=OneWay}" Value="{x:Static Models:DBConnectionState.Unsaved}">
                <Setter Property="Background" Value="{StaticResource DBConnectionState.Unsaved}" />
            </DataTrigger>

        </Style.Triggers>

    </Style>

</ResourceDictionary>